package com.zzw.hj61;

import java.util.Scanner;

/**
 * @Project: hw_java
 * @Description: 放苹果
 * @Author: zzw
 */
// 注意类名必须为 Main, 不要有任何 package xxx 信息
public class Main {
    // 动态规划/递归
    public static int putApple(int m, int n) {
        if (m <= 1 || n == 1) {
            return 1;
        } else if (m < n) {
            return putApple(m, m);
        } else {
            return putApple(m, n - 1) + putApple(m - n, n);
        }
    }

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int m = in.nextInt();
        int n = in.nextInt();
        System.out.println(putApple(m, n));
    }
}